package com.acc.sys.framework;

import apijson.RequestMethod;
import apijson.framework.APIJSONObjectParser;
import apijson.framework.APIJSONParser;
import apijson.orm.SQLConfig;
import com.alibaba.fastjson.JSONObject;

public class AccParser extends APIJSONParser<Long> {
    public AccParser(RequestMethod requestMethod, boolean needVerify) {
        super(requestMethod, needVerify);
    }

    public AccParser() {
        super();
    }

    @Override
    public APIJSONObjectParser<Long> createObjectParser(JSONObject request, String parentPath, SQLConfig<Long> arrayConfig, boolean isSubquery, boolean isTable, boolean isArrayMainTable) throws Exception {
        return (new AccObjectParser(this.getSession(), request, parentPath, arrayConfig, isSubquery, isTable, isArrayMainTable)).setMethod(this.getMethod()).setParser(this);
    }


    //设置最大查询数量
    @Override
    public int getMaxQueryCount() {
        return 1000;
    }

    @Override
    public int getMaxSQLCount() {
        return 1000;
    }

    /**
     * 批量新增时，最大数据量
     *
     * @return
     */
    @Override
    public int getMaxObjectCount() {
        return 100;
    }

    @Override
    public int getMaxQueryDepth() {
        return 100;
    }

    @Override
    public int getMaxUpdateCount() {
        return 100;
    }
}
